package com.ssm.server.boxes.controller;

import com.ssm.server.boxes.service.BoxesService;
import com.ssm.server.common.JsonData;
import com.ssm.server.user.service.UserService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author zhangyibo
 */
@RestController
public class BoxesController {
	@Autowired
	private BoxesService boxesService;

//	/*
//	 * 根据箱号获取
//	 */
//	@RequestMapping("/boxes/getBoxesByBoxesNumber")
//	public JsonData getBoxesByBoxesNumber(@RequestParam Map<String, String> param) throws Exception {
//		return boxesService.getBoxesByBoxesNumber(param);
//	}
	


	/*
	 * 根据级别查询
	 */
	@RequestMapping("/boxes/getboxByBoxLevel")
	public JsonData getboxByBoxLevel(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.getboxByBoxLevel(param);
	}

	/*
	 * 根据类型获取类目
	 */
	@RequestMapping("/boxes/getClassesByState")
	public JsonData getClassesByState(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.getClassesByState(param);
	}

	/*
	 * 统计当前剩余箱数
	 */
	@RequestMapping("/boxes/countBoxes")
	public JsonData countBoxes(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.countBoxes(param);
	}

	/*
	 * 统计当前剩余箱数
	 */
	@RequestMapping("/boxes/getBoxesByClassId")
	public JsonData getBoxesByClassId(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.getBoxesByClassId(param);
	}

	/*
	 * 轮播图
	 */
	@RequestMapping("/boxes/getSlideshow")
	public JsonData getSlideshow(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.getSlideshow(param);
	}
	
	/*
	 * 类目类型
	 */
	@RequestMapping("/classes/getClassesType")
	public JsonData getClassesType(@RequestParam Map<String, String> param) throws Exception {
		return boxesService.getClassesType(param);
	}
	
	
}
